function NextLevelMenu(){
    Sprite.apply(this);
    Menu.apply(this);
    this.background.alpha = 0.5;
    
    this.text = new TextField();
    var format = new TextFormat("Arial", 30, black);
    format.align = TextFormatAlign.CENTER;
    this.text.setTextFormat(format);
    this.text.text = "Gratulujem!" + '\n' + 
    "Chceš pokračovat daľej?"; 
    this.text.wordWrap = true;
    this.text.width = 500;//this.text.textWidth; 
    this.text.height = this.text.textHeight;
    this.text.x = MainContainerWidth/2 - this.text.width/2; 
    this.text.y = 150;
    this.addChild(this.text);
    
    
    
    this.againButton = new Button("Hrať znova");
    this.continueButton = new Button("Pokračovať");
    
    var buttonsWidth = MARGIN + this.againButton.width + this.continueButton.width;
    
    this.againButton.x =  MainContainerWidth/2 - buttonsWidth/2; 
    this.againButton.y = this.text.y + this.text.height + MARGIN*2;
    
    this.continueButton.x = MainContainerWidth/2 - buttonsWidth/2 + MARGIN + this.againButton.width;
    this.continueButton.y = this.text.y + this.text.height + MARGIN*2;
    
    
    
    
    this.addChild(this.againButton);
    this.addChild(this.continueButton);
    
    this.againButton.addEventListener(MouseEvent.CLICK, clickAgain);
    this.continueButton.addEventListener(MouseEvent.CLICK, clickContinue);
    
    function clickAgain(e){
        Game._game.RestartLevel();
    }

    function clickContinue(e){
        var level = e.target.parent.parent;
        Game._game.score.addScore (level.requiredTime,level.timer.time/10,level.type);
        Game._game.NextLevel();
    }
}
NextLevelMenu.prototype = new Sprite();